﻿import React from 'react';
import Header from './Header';
import SalesList from './SalesList';
import {Pagination} from 'antd';
import action from '../../store/actions/historyPurchase';
import {connect} from 'react-redux';

class HistorySales extends React.Component {
  // 分页改变
  pageChange = page => {
    // 分页改变事件
  };

  render() {
    return (
      <div>
        <Header/>
        <SalesList/>
        <Pagination
          current={this.props.current}
          onChange={this.pageChange}
          total={this.props.pageCount ? this.props.pageCount : 1}
          style={{textAlign: 'center', marginTop: '20px'}}
          pageSize={10}
          hideOnSinglePage
        />
      </div>
    );
  }
}

const mapStateToProps = state => state.historyPurchase;
export default connect(mapStateToProps, action)(HistorySales);
